package collections4;

import java.util.Scanner;
/**
 * 有问题
 * @author admin
 *
 */
public class StudentManage {
	/**
	 * 进不去  找不出问题在哪
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Xiancheng st = new Xiancheng();
		Scanner input = new Scanner(System.in);
	     st.readMessage();
	     //System.out.println("hehe");
	     st.start();
	    // System.out.println("heh");
		while (true) {
			System.out.println("1.显示学生信息\n2.增加学生信息\n3.修改学生信息\n4.删除学生信息\n9.退出");
			System.out.println("请输入你的选择：");
			String choice = input.next();
			switch (choice) {
			case "1":
				System.out.println("***显示学生信息***");
				st.showAll();
				break;
			case "2":
				System.out.println("***增加学生信息***");
				System.out.println("请输入学生姓名：");
				String name = input.next();
				System.out.println("请输入学生身份证：");
				String identification = input.next();
				System.out.println("请输入学生学号：");
				String numberStudent = input.next();
				System.out.println("请输入学生年龄：");
				String age = input.next();
				st.addStu(numberStudent, name, age, identification);
				break;
			case "3":
				System.out.println("***修改学生信息***");
				System.out.println("请输入需要修改的学生姓名：");
				String amendName = input.next();
				System.out.println("请输入学生身份证：");
				String amendIdentification = input.next();
				System.out.println("请输入学生学号：");
				String amendNumberStudent = input.next();
				System.out.println("请输入学生年龄：");
				String amendAge = input.next();
				Student amendStudent = new Student(amendName, amendIdentification, amendNumberStudent,amendAge);
				boolean s = st.reviseStu(amendNumberStudent);
				if(s){
					System.out.println("删除成功");
				}else{
					System.out.println("删除失败");
				}
				break;
			case "4":
				System.out.println("***删除学生信息***");
				System.out.println("请输入学生学号：");
				String inputnumberStudent = input.next();
				break;
			case "9":
				System.out.println("***退出***");
				return;
			}
		}
	}

}
